Don't reserve space for border when the shadow type for the menubar is
authorOwen Taylor <otaylor@redhat.com>
Wed, 27 Feb 2002 21:57:27 +0000 (21:57 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 27 Feb 2002 21:57:27 +0000 (21:57 +0000)
Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate):
        Don't reserve space for border when the shadow type
        for the menubar is "none". (#61843)

        * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
        offset for right-justified menu items.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmenubar.c

index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index a1707ecebe41e9cd78d4364c4eabce1edd2ecdec..499609d296d56375b1fc7d56e26d8c64f18ef5c3 100644 (file)
@@ -1,3 +1,12 @@
+Wed Feb 27 14:58:12 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_request/allocate): 
+       Don't reserve space for border when the shadow type
+       for the menubar is "none". (#61843)
+
+       * gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Fix
+       offset for right-justified menu items.
+
 Wed Feb 27 14:45:21 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Go
index 84a40da83bde4e33e75b1e5009ca78b1c663ed0d..3a3e9399d9e31a5f662bbea1f168e35c0563a07f 100644 (file)
@@ -228,14 +228,18 @@ gtk_menu_bar_size_request (GtkWidget      *widget,
       gtk_widget_style_get (widget, "internal_padding", &ipadding, NULL);
       
       requisition->width += (GTK_CONTAINER (menu_bar)->border_width +
-                            widget->style->xthickness +
                              ipadding + 
                             BORDER_SPACING) * 2;
       requisition->height += (GTK_CONTAINER (menu_bar)->border_width +
-                             widget->style->ythickness +
                               ipadding +
                              BORDER_SPACING) * 2;
 
+      if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
+       {
+         requisition->width += widget->style->xthickness * 2;
+         requisition->height += widget->style->ythickness * 2;
+       }
+
       if (nchildren > 0)
        requisition->width += 2 * CHILD_SPACING * (nchildren - 1);
     }
@@ -271,17 +275,22 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
   if (menu_shell->children)
     {
       child_allocation.x = (GTK_CONTAINER (menu_bar)->border_width +
-                           widget->style->xthickness +
                             ipadding + 
                            BORDER_SPACING);
-      offset = child_allocation.x;     /* Window edge to menubar start */
-
       child_allocation.y = (GTK_CONTAINER (menu_bar)->border_width +
-                           widget->style->ythickness +
                             ipadding +
                            BORDER_SPACING);
+
+      if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
+       {
+         child_allocation.x += widget->style->xthickness;
+         child_allocation.y += widget->style->ythickness;
+       }
+      
       child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2);
 
+      offset = child_allocation.x;     /* Window edge to menubar start */
+
       children = menu_shell->children;
       while (children)
        {
@@ -297,11 +306,11 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
           child_requisition.width += toggle_size;
           
          /* Support for the right justified help menu */
-         if ( (children == NULL) && (GTK_IS_MENU_ITEM(child))
+         if ((children == NULL) && (GTK_IS_MENU_ITEM(child))
              && (GTK_MENU_ITEM(child)->right_justify)) 
            {
              child_allocation.x = allocation->width -
-                 child_requisition.width - CHILD_SPACING - offset;
+                 child_requisition.width - offset;
            }
          if (GTK_WIDGET_VISIBLE (child))
            {